package com.gulimall.coupon.api.client;

import com.gulimall.common.utils.ServiceResponse;
import com.gulimall.coupon.api.dto.CouponInDTO;
import com.gulimall.coupon.api.dto.CouponOutDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


/**
 * 优惠券信息
 *
 * @author aliuql
 * @email 17701057157@qq.com
 * @date 2021-11-15 14:31:25
 */
@FeignClient(value = "gulimall-coupon", path = "/coupon/coupon")
public interface CouponClient {

    /**
     * 获取详情
     */
    @GetMapping("/getDetail")
    ServiceResponse<CouponOutDTO> getDetail(@RequestParam("id") Long id);

    /**
     * 获取明细列表
     */
    @GetMapping("/getList")
    ServiceResponse<CouponOutDTO> getList(@RequestBody CouponInDTO couponInDTO);

    /**
     * 获取明细列表(分页)
     */
    @GetMapping("/getPage")
    ServiceResponse<CouponOutDTO> getPage(@RequestBody CouponInDTO couponInDTO);

    /**
     * 保存
     */
    @PostMapping("/save")
    ServiceResponse<Void> save(@RequestBody CouponInDTO couponInDTO);

    /**
     * 修改
     */
    @PostMapping("/update")
    ServiceResponse<Void> update(@RequestBody CouponInDTO couponInDTO);

    /**
     * 批量删除
     */
    @PostMapping("/deleteBatch")
    ServiceResponse<Void> deleteBatch(@RequestBody List<Long> ids);
}
